package com.example.task;

import com.example.service.OrdersService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

@Component
public class OrderCancellationTask{

    @Autowired
    private OrdersService ordersService;

//    @Scheduled(cron = "0 */10 * * * *") // 每10分钟执行一次
//    public void cancelOrders() {
//        System.out.println("开始执行取消订单任务: " + System.currentTimeMillis());
//        ordersService.cancelExpiredOrders();
//    }

}
